package com.jiyun.controller;


import com.jiyun.entity.Reviews;
import com.jiyun.entity.vo.ReviewsVo;
import com.jiyun.service.IReviewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 23052
 * @since 2025-02-18
 */
@RestController
@RequestMapping("/reviews")
public class ReviewsController {

    @Autowired
    private IReviewsService reviewsService;
    //查询所有评论
    @GetMapping("/findReviews")
    public List<ReviewsVo> findReviews(@RequestParam(name = "tid",required = true) Integer tid){
     List<ReviewsVo> list =  reviewsService.findReviews(tid);
     return list;
    }

}
